<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ include file="/common/base.jsp"%>
<% 
  //实例化AreaDao
  Family_memberDAO family_memberDAO=new Family_memberDAO();
  Join_nhDao join_nhDao=new Join_nhDao();
  ChronicdisDao chronicdisDao=new ChronicdisDao();
  List<Family_member> familyList=family_memberDAO.findByKeyValue("null", null);
  List<Join_nh> familyJoin_nhList=join_nhDao.findFamilyJoin_nhList();
  List<Chronicdis> chronicdisList=chronicdisDao.findByKeyValue("null", null);
  
  //实例化AreaDao
  AreaDao areaDao=new AreaDao();
  int[]grades={1,2,3,4,5,6,7,8,9};
  List<Area> areaList=areaDao.findListByGrade(grades);
%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<base href="<%=basePath%>">

<title>家庭档案信息列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/admin.css">
<script src="js/jquery-1.4.4.min.js"></script>
<script src="js/admin.js"></script>
<script src="third/layui/layui.all.js"></script>
<link rel="stylesheet" href="third/layui/css/layui.css">
</head>
<script type="text/javascript">
    function getkey(a) {
        var IDcard = document.getElementById("IDcard").value;
 		var Illcode = document.getElementById("Illcode").value;
 		var areacode = document.getElementById("areacode").value;
 		
 		var startTime = document.getElementById("startTime").value;
 		var endTime = document.getElementById("endTime").value;
  a.href = '<%=path%>/biz/BX_recordServlet?m=findByLike&IDcard=' + IDcard+'&Illcode='+Illcode+'&areacode='+areacode +'&startTime='+startTime+'&endTime='+endTime;
  }
</script>

<body>
	<form method="post" action="" id="listform">
		<div class="panel admin-panel">
			<div class="panel-head">
				<strong class="icon-reorder">家庭档案信息列表</strong>
			</div>
			<div class="padding border-bottom">
				<ul class="search" style="padding-left:10px;">
					<li><a class="button border-main icon-plus-square-o"
						href="<%=path%>/biz/BX_recordServlet?m=input"> 添加家庭档案信息</a></li>
					<input type="text" placeholder="姓名" name="IDcard" id="IDcard"
						class="input" style="width:190px; line-height:17px;display:inline-block" list="family" 
						value="<%=request.getParameter("IDcard")==null?"":request.getParameter("IDcard")%>"/> 
						<datalist id="family" class="selectDate" aria-invalid="false"> 
							<%
						  for(Family_member m:familyList){ 
						
						  %>
							<option value="<%=m.getIDcard()%>"><%=m.getMembername()%></option>
							<%} %>

						</datalist >
						<input type="text" placeholder="慢病名称" name="Illcode" id="Illcode"
						class="input" style="width:110px; line-height:17px;display:inline-block" list="Ill" 
						value="<%=request.getParameter("Illcode")==null?"":request.getParameter("Illcode")%>"/> 
						<datalist id="Ill" class="selectDate" aria-invalid="false"> 
				
						<%
						  for(Chronicdis m:chronicdisList){ 
						
						  %>
							<option value="<%=m.getIllcode()%>"><%=m.getIllname()%></option>
							<%} %>
						</datalist >
						<input type="text" placeholder="请输入行政区域" name="areacode" id="areacode"
						class="input" style="width:190px; line-height:17px;display:inline-block" list="area"
						value="<%=request.getParameter("areacode")==null?"":request.getParameter("areacode")%>"/> 
						<datalist id="area" class="selectDate" aria-invalid="false"> 
							<%
						  for(Area m:areaList){ 
						
						  %>
							<option value="<%=m.getAreacode()%>" ><%=m.getAreaname() %></option>
							<%} %>

						</datalist >

			<div class="layui-inline">
				<label class="layui-form-label">日期</label>
				<div class="layui-input-inline">
					<input type="text" name="startTime" id="startTime" lay-verify="startTime"
						placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input" 
						value="<%=request.getParameter("startTime")==null?"":request.getParameter("startTime")%>">
				</div>
			</div>
			至
			<div class="layui-inline">
				
				<div class="layui-input-inline">
					<input type="text" name="endTime" id="endTime" lay-verify="endTime"
						placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input" 
						value="<%=request.getParameter("endTime")==null?"":request.getParameter("endTime")%>">
				</div>
			</div>

						<a href="" onclick="getkey(this)" 
						class="button border-main icon-search"
						onclick="changesearch()"> 搜索</a>
						
						<a class="button border-green icon-search" > 导出Excel</a>
						</li>
				</ul>
				</form>
			</div>
			<table class="table table-hover text-center">
				<tr>	<th width="50">序号</th>
					<th width="20" style="text-align:center;">&nbsp;</th>
					<th>行政区域</th>
					<th>报销记录编码</th>
					<th>姓名</th>
					
					<th>慢性病名称</th>
					<th>总费用</th>
					<th>封顶线</th>
					<th>报销金额</th>
					<th>就诊时间</th>
					<th>报销时间</th>
					<th>就诊机构</th>
					<th>报销状态</th>
					<th>经办人</th>
				</tr>
				<%
					int i=1;
				%>
				<c:forEach items="${list}" var="item">
				<tr>
				<td><%=(i++) %></td>
				<td><input type="checkbox" name="ids"
						value="${item.bx_record_code}" /></td>
					<td>${item.area.getAreaname()}</td>
					<td>${item.bx_record_code}</td>
					<td>${item.family_member.getMembername()}</td>
					<td>${item.chronicdis.getIllname()}</td>
					<td>${item.all_cost}</td>
					<td>${item.policy.getMax_line()}</td>
					<td>${item.bx_cost}</td>
					<td>${item.vis_time}</td>
					<td>${item.bx_time}</td>
					
					<td>${item.medical.getJgmc()}</td>
					<td>
					<c:if test="${item.bx_state==1}"><p style="color: green;">报销成功</p></c:if>
					<c:if test="${item.bx_state==0}">
						<a class="button border-red" href="<%=path%>/biz/BX_recordServlet?m=sign&id=${item.bx_record_code}">
							<span class="icon-plus-square-o"></span>签字确认</a>
					</c:if>
					</td>
					<td>${item.user_id}</td>
					<td></td>
					
				</tr>
				</c:forEach>
			</table>
			<div class="pagelist">
				
		</div>
	</form>
<!-- 以下是时间控件 -->
<script>
layui.use('laydate', function(){
  var laydate = layui.laydate;
  
  //执行一个laydate实例
  laydate.render({
    elem: '#startTime' //指定元素
    ,value: '${tbPoltVote.votestartTime}'
    ,type: 'datetime',
    isInitValue: true
  });
});
</script>
<script>
layui.use('laydate', function(){
  var laydate = layui.laydate;
  
  //执行一个laydate实例
  laydate.render({
    elem: '#endTime' //指定元素
    ,value: '${tbPoltVote.voteendTime}'
    ,type: 'datetime'
    ,isInitValue: true
  });
});
</script>
</body>
</html>
